<?php

namespace app\store\model;
use app\common\model\UserJob as UserJobModel;

/**
 * 工作经历
 */
class UserJob extends UserJobModel
{
    /**
     * 添加
     * @param $data
     * @param $record_id
     */
    public function add($data,$record){
        self::destroy(['record_id'=>$record['record_id']]);
        foreach ($data as $item){
            if(empty($item['job_name'])){
                continue;
            }
            $_model = clone $this;
            $item['record_id'] = $record['record_id'];
            $item['user_id'] = $record['user_id'];
            $item['admin_id'] = $record['admin_id'];
            $_model->save($item);
        }
    }
}